<?php
    $menu_top = $this->requestAction('block/top_nav');
    $controller_name = $this->params['controller'];
    if($controller_name != 'intro')
    {
?> 
<div class="top-nav">
    <span class="line-left">&nbsp;</span>
    <ul>
    <?php
        foreach($menu_top as $menu)
        {
            if($menu['menu_desc']['link'] != '#')
                $pl = $this->General->base_url() . $menu['menu_desc']['link'];
            else
                $pl = 'javascript:void(0)';
    ?>
        <li>
            <a href="<?php echo $pl ?>"><?php echo $menu['menu_desc']['title'] ?></a>
            <img class="bullet-down" src="<?php echo $this->webroot ?>images/bullet-down.png" />
            <?php
                if(!empty($menu['sub_menu']))
                {
                    echo '<ul>';
                    foreach($menu['sub_menu'] as $m)
                    {
            ?>
                        <li><a href="<?php echo $this->General->base_url() . $m['menu_desc']['link'] ?>"><?php echo $m['menu_desc']['title'] ?></a></li>
            <?php 
                    }
                    echo '</ul>';
                }
            ?>
        </li>
    <?php
        }
    ?>
    <?php
    
        //$info_user = $this->requestAction('users/get_user_login');
        //print_r($info_user); exit;
        if(isset($info_user['id']))
        {
    ?>
        <li>
            <a href="javascript:void(0)"><?php echo strtoupper($info_user['name']) ?></a>
            <img class="bullet-down" src="<?php echo $this->webroot ?>images/bullet-down.png" />
            <ul>
                <li><a href="<?php echo $this->General->base_url() ?>users"><?php $this->General->translate('user') ?></a></li>
                <li><a href="<?php echo $this->General->base_url() ?>users/edit"><?php $this->General->translate('edit_user') ?></a></li>
                <li><a href="<?php echo $this->General->base_url() ?>users/logout"><?php $this->General->translate('logout') ?></a></li>
            </ul>
        </li>
    <?php
        }
        else
        {
    ?>
        <li>
            <a href="javascript:void(0)"><?php $this->General->translate('login_register') ?></a>
            <img class="bullet-down" src="<?php echo $this->webroot ?>images/bullet-down.png" />
            <ul>
                <li><a href="<?php echo $this->General->base_url() ?>users/login"><?php $this->General->translate('login') ?></a></li>
                <li><a href="<?php echo $this->General->base_url() ?>users/register"><?php $this->General->translate('register') ?></a></li>
            </ul>
        </li>
    <?php
        }
    ?>
    </ul>
</div>
<?php
    }
?>